﻿using System;
using System.Collections.Generic;
using System.Reflection;
using System.Text;

namespace ESoft.RabbitMQ
{
    /// <summary>
    /// RabbitMQ服务类
    /// </summary>
    public interface IRabbitMQService
    {
        /// <summary>
        /// 发送消息
        /// </summary>
        /// <param name="payload"></param>
        /// <param name="routeKey"></param>
        void Send(IPayload payload, string routeKey);

        /// <summary>
        /// 发送延时消息
        /// </summary>
        /// <param name="payload"></param>
        /// <param name="routeKey">路由键</param>
        /// <param name="delayMs">延迟毫秒数</param>
        void SendDelay(IPayload payload, string routeKey, int delayMs);

        /// <summary>
        /// 绑定消费者到指定队列
        /// </summary>
        /// <param name="consumers">对象集合</param>
        /// <param name="assemblies"></param>
        void StartConsumers(IEnumerable<IConsumer> consumers , params Assembly[] assemblies);
    }
}
